home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 6 / MacMania 6.toast / / Tools&Utilities / TouchMe 1.2□ / touchMe 1.2 Folder / touchMe source codes / CW11 PP source / source / touchMeAppleEvents.r < prev    next >
Encoding:
Text File  |  1997-04-25  |  9.1 KB  |  361 lines  |  [TEXT/CWIE]

  1. // ==================================================
  2. //    TouchMeAppleEvents.r
  3. //    Copyright (C) 1996-1997 Mizutori Tetsuya
  4. //    July 4, 1996; February 3, 1997; April 23, 1997.
  5. // ==================================================
  6. //    All documents are pretty-printed in 10-point Geneva font.
  7.  
  8. #define SystemSevenOrLater    TRUE
  9.  
  10. #include <Types.r>
  11. #include <SysTypes.r>
  12. #include <AEObjects.r>
  13. #include <AERegistry.r>
  14. #include <AEUserTermTypes.r>
  15. #include <AppleEvents.r>
  16. #include <ASRegistry.r>
  17.  
  18. #include <PowerPlant.r>
  19.  
  20. #include <AEPowerPlantSuite.h>
  21. #include <AETextSuite.h>
  22. #include <AEDebugSuite.h>
  23.  
  24. //    Macros for some common patterns...
  25. //    (the files below assume the presence of these macros)
  26. #define Reserved4_        reserved, reserved, reserved, reserved
  27. #define Reserved8_        Reserved4_, Reserved4_
  28. #define Reserved12_        Reserved8_, Reserved4_
  29. #define ReservedVerb_    Reserved8_, verbEvent, reserved, reserved, reserved
  30. #define ReservedPrep_    Reserved8_, reserved, prepositionParam, notFeminine, notMasculine, singular
  31. #define ReservedApost_    Reserved8_, noApostrophe, notFeminine, notMasculine, singular
  32.  
  33. // TouchMe AppleEvent Terminology
  34.  
  35. #define USING_REZ_COMPILER TRUE
  36. #define typedef
  37. #define ETouchMe_Suite
  38. #define ETouchMePref_Class
  39. #define ETouchMeStamp_Class
  40. #define EnumTouchMe_Type
  41. #define EnumTouchMe_Flag
  42. #include "CTouchMeAppleEvents.h"
  43. #undef typedef
  44. #undef ETouchMe_Suite
  45. #undef ETouchMePref_Class
  46. #undef ETouchMeStamp_Class
  47. #undef EnumTouchMe_Type
  48. #undef EnumTouchMe_Flag
  49. #undef USING_REZ_COMPILER
  50.  
  51.  
  52. // --------------------------------------------------
  53. //    • Apple Event Dispatching Table
  54. // --------------------------------------------------
  55.  
  56. resource 'aedt' (1000, "touchMe Suite") {
  57.     {    /* array: 6 elements */
  58.         /* [1] */
  59.         kAETouchMeSuite,    kAEGetPrefs,    ae_GetPrefs,
  60.         /* [2] */
  61.         kAETouchMeSuite,    kAESetPrefs,    ae_SetPrefs,
  62.         /* [3] */
  63.         kAETouchMeSuite,    kAELoadPrefs,    ae_LoadPrefs,
  64.         /* [4] */
  65.         kAETouchMeSuite,    kAESavePrefs,    ae_SavePrefs,
  66.         /* [5] */
  67.         kAETouchMeSuite,    kAETouch,        ae_Touch,
  68.         /* [6] */
  69.         kAETouchMeSuite,    kAEFetch,        ae_Fetch
  70.     }
  71. };
  72.  
  73.  
  74. // --------------------------------------------------
  75. //    • Apple Event Terminology Extension
  76. // --------------------------------------------------
  77.  
  78. resource 'aete' (0, "English") {
  79.     0x01,                                    // major version in BCD
  80.     0x10,                                    // minor version in BCD
  81.     english,                                    // language code
  82.     roman,                                    // script code
  83.     {    /* array Suites: 2 elements */
  84.         /* [1] */
  85.         "Required Suite",                        // suite name
  86.         "Terms that every application should support",    // suite description
  87.         kAERequiredSuite,                        // suite ID
  88.         1,                                    // suite level
  89.         1,                                    // suite version
  90.         {},    /* array Events: 0 elements */
  91.         {},    /* array Classes: 0 elements */
  92.         {},    /* array ComparisonOps: 0 elements */
  93.         {},    /* array Enumerations: 0 elements */
  94.  
  95.         /* [2] */
  96.         "touchMe Suite",                            // suite name
  97.         "Update the date time stamp of creation & modification on the file",
  98.         kAETouchMeSuite,
  99.         1,
  100.         1,
  101.         {    /* array Events: 6 elements */
  102.             /* [1] */
  103.             "get prefs",                    // event name
  104.             "Get the settings information",        // event description
  105.                 kAETouchMeSuite,            // event class
  106.                 kAEGetPrefs,                // event ID
  107.             cTouchMePref,                    // reply type
  108.             "list of current settings",            // reply description
  109.                 replyRequired,                // if the reply is required
  110.                 listOfItems,                // if the reply must be a list
  111.                 notEnumerated,                // if the type is enumerated
  112.                 notTightBindingFunction,        // if the message has tight binding precedence
  113.                 ReservedVerb_,                // these 12 bits are reserved
  114.             typeAETouchMeType,                // direct param type
  115.             "creation or modification type",        // direct param description
  116.                 directParamRequired,            // if the direct param is required
  117.                 singleItem,                    // if the param must be a list
  118.                 enumerated,                // if the type is enumerated
  119.                 doesntChangeState,            // if the event changes server's state
  120.                 Reserved12_,                // these 12 bits are reserved
  121.             {},    /* array OtherParams: 0 elements */
  122.  
  123.             /* [2] */
  124.             "set prefs",                    // event name
  125.             "Set the settings information",
  126.                 kAETouchMeSuite,
  127.                 kAESetPrefs,
  128.             noReply,
  129.             "",
  130.                 replyOptional,
  131.                 singleItem,
  132.                 notEnumerated,
  133.                 notTightBindingFunction,
  134.                 ReservedVerb_,
  135.             typeAETouchMeType,
  136.             "creation or modification type",
  137.                 directParamRequired,
  138.                 singleItem,
  139.                 enumerated,
  140.                 changesState,
  141.                 Reserved12_,
  142.             {    /* array OtherParams: 1 elements */
  143.                 /* [1] */
  144.                 "to",                        // parameter name
  145.                     keyAEData,                // parameter keyword
  146.                     typeWildCard,            // parameter type
  147.                     "list of new settings",        // parameter description
  148.                         required,            // if param is optional
  149.                         singleItem,            // if the param must be a list
  150.                         notEnumerated,        // if the type is enumerated
  151.                         ReservedPrep_        // these 13 bits are reserved
  152.             },
  153.  
  154.             /* [3] */
  155.             "load prefs",                    // event name
  156.             "Load the settings from preferences file",
  157.                 kAETouchMeSuite,
  158.                 kAELoadPrefs,
  159.             noReply,
  160.             "",
  161.                 replyOptional,
  162.                 singleItem,
  163.                 notEnumerated,
  164.                 notTightBindingFunction,
  165.                 ReservedVerb_,
  166.             noParams,
  167.             "",
  168.                 directParamOptional,
  169.                 singleItem,
  170.                 notEnumerated,
  171.                 doesntChangeState,
  172.                 Reserved12_,
  173.             {},    /* array OtherParams: 0 elements */
  174.  
  175.             /* [4] */
  176.             "save prefs",                    // event name
  177.             "Save the settings to preferences file",
  178.                 kAETouchMeSuite,
  179.                 kAESavePrefs,
  180.             noReply,
  181.             "",
  182.                 replyOptional,
  183.                 singleItem,
  184.                 notEnumerated,
  185.                 notTightBindingFunction,
  186.                 ReservedVerb_,
  187.             noParams,
  188.             "",
  189.                 directParamOptional,
  190.                 singleItem,
  191.                 notEnumerated,
  192.                 doesntChangeState,
  193.                 Reserved12_,
  194.             {},    /* array OtherParams: 0 elements */
  195.  
  196.             /* [5] */
  197.             "touch",                        // event name
  198.             "Touch the files",
  199.                 kAETouchMeSuite,
  200.                 kAETouch,
  201.             noReply,
  202.             "",
  203.                 replyOptional,
  204.                 singleItem,
  205.                 notEnumerated,
  206.                 notTightBindingFunction,
  207.                 ReservedVerb_,
  208.         //    typeWildCard,
  209.             typeAlias,
  210.             "object[s] to touch; a file or list of files",
  211.                 directParamRequired,
  212.         //        singleItem,
  213.                 listOfItems,
  214.                 notEnumerated,
  215.                 changesState,
  216.                 Reserved12_,
  217.             {},    /* array OtherParams: 0 elements */
  218.  
  219.             /* [6] */
  220.             "fetch",                        // event name
  221.             "Fetch the date time stamp of file, and set the fields",
  222.                 kAETouchMeSuite,
  223.                 kAEFetch,
  224.             cTouchMeStamp,
  225.             "creation and modification date time",
  226.                 replyRequired,
  227.                 listOfItems,
  228.                 notEnumerated,
  229.                 notTightBindingFunction,
  230.                 ReservedVerb_,
  231.         //    typeWildCard,
  232.             typeAlias,
  233.             "object[s] to fetch; a file or list of files",
  234.                 directParamRequired,
  235.         //        singleItem,
  236.                 listOfItems,
  237.                 notEnumerated,
  238.                 changesState,
  239.                 Reserved12_,
  240.             {}    /* array OtherParams: 0 elements */
  241.  
  242.         },
  243.  
  244.         {    /* array Classes: 2 elements */
  245.             /* [1] */
  246.             "prefs",                        // class name
  247.             cTouchMePref,                    // class ID
  248.             "Settings information",            // class description
  249.             {    /* array Properties: 3 elements */
  250.                 /* [1] */
  251.                 "enabled",                    // property name
  252.                     pPref_Enabled,            // property ID
  253.                     typeBoolean,            // property class
  254.                     "",                    // property description
  255.                         reserved,
  256.                         singleItem,            // if the property must be a list
  257.                         notEnumerated,        // if the type is enumerated
  258.                         readWrite,            // can read or write it
  259.                         ReservedApost_,        // these 12 bits are reserved
  260.  
  261.                 /* [2] */
  262.                 "flag",                    // property name
  263.                     pPref_Flag,
  264.                     typeAETouchMeFlag,
  265.                     "",
  266.                         reserved,
  267.                         singleItem,
  268.                         enumerated,
  269.                         readWrite,
  270.                         ReservedApost_,
  271.  
  272.                 /* [3] */
  273.                 "value",                    // property name
  274.                     pPref_Value,
  275.                     typeLongDateTime,
  276.                     "",
  277.                         reserved,
  278.                         singleItem,
  279.                         notEnumerated,
  280.                         readWrite,
  281.                         ReservedApost_
  282.             },
  283.             {},    /* array Elements: 0 elements */
  284.  
  285.             /* [2] */
  286.             "time stamp",                    // class name
  287.             cTouchMeStamp,
  288.             "Creation and Modification date time",
  289.             {    /* array Properties: 2 elements */
  290.                 /* [1] */
  291.                 "creation date",                // property name
  292.                     pStamp_Creation,
  293.                     typeLongDateTime,
  294.                     "creation date",
  295.                         reserved,
  296.                         singleItem,
  297.                         notEnumerated,
  298.                         readWrite,
  299.                         ReservedApost_,
  300.  
  301.                 /* [2] */
  302.                 "modification date",            // property name
  303.                     pStamp_Modification,
  304.                     typeLongDateTime,
  305.                     "modification date",
  306.                         reserved,
  307.                         singleItem,
  308.                         notEnumerated,
  309.                         readWrite,
  310.                         ReservedApost_
  311.             },
  312.             {},    /* array Elements: 0 elements */
  313.  
  314.         },
  315.  
  316.         {},    /* array ComparisonOps: 0 elements */
  317.  
  318.         {    /* array Enumerations: 2 elements */
  319.             /* [1] */
  320.             typeAETouchMeType,                    // Enumeration ID
  321.             {    /* array Enumerators: 2 elements */
  322.                 /* [1] */
  323.                 "creation",                        // Enumerator name
  324.                     kEnumType_Creation,            // Enumerator ID
  325.                     "creation type",                // Enumerator comment
  326.  
  327.                 /* [2] */
  328.                 "modification",                    // Enumerator name
  329.                     kEnumType_Modification,
  330.                     "modification type"
  331.             },
  332.  
  333.             /* [2] */                            // Enumeration ID
  334.             typeAETouchMeFlag,
  335.             {    /* array Enumerators: 4 elements */
  336.                 /* [1] */
  337.                 "current",                        // Enumerator name
  338.                     kEnumFlag_Current,
  339.                     "by current date time",
  340.  
  341.                 /* [2] */
  342.                 "exact",                        // Enumerator name
  343.                     kEnumFlag_Excact,
  344.                     "by exact date time",
  345.  
  346.                 /* [3] */
  347.                 "firstone",                        // Enumerator name
  348.                     kEnumFlag_First,
  349.                     "by first item",
  350.  
  351.                 /* [4] */
  352.                 "firstset",                        // Enumerator name
  353.                     kEnumFlag_FirstSet,
  354.                     "by first item and set"
  355.             }
  356.         }
  357.     }
  358. };
  359.  
  360. // end of resources
  361.